<!DOCTYPE html> 
<html> 
    <head> 
        <meta charset="utf-8" /> 
        <meta name="format-detection" content="telephone=no" /> 
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> 
        <link rel="stylesheet" type="text/css" href="css/index.css" /> 
        <title>Hello World</title> 
    </head> 
    <body> 
        <div class="app"> 
            <h1>Pacientes</h1> 
            <form id="formulario" name="formulario" method="get" action="pacientes.inmobiliariasetrini.com.ar/notificaciones_push/registro.php"> 
                <p><input type="text" id="name" name="name" placeholder="Nombre" required></p> 
                <p><input type="text" id="email" name="email" placeholder="Correo" required></p> 
                <p><input type="text" name="regId" id="regId" readonly="readonly" placeholder="regId"></p> 
                <button type="button" onclick="registrar();">Registar</button> 
            </form>   

            <div id="deviceready" class="blink"> 
                <p class="event listening">Connecting to Device</p> 
                <p class="event received">Device is Ready</p> 
            </div>   
        </div> 
        <script type="text/javascript" src="phonegap.js"></script> 
        <script type="text/javascript" src="PushNotification.js"></script> 
        <script type="text/javascript" src="js/index.js"></script> 
        <script type="text/javascript" src="android.json"></script>
        <script type="text/javascript"> 
        //El registro al servicio de google lo hacemos automáticamente 
        app.initialize(); 
        function registrar(){ 
            var nombre = document.getElementById('name').value; 
            var email = document.getElementById('email').value; 
            var regId = document.getElementById('regId').value; 
            if (regId != "") { 
                if (nombre != "" && email != "") { 
                    //Enviamos los datos al servidor php 
                    document.formulario.submit(); 
                } 
                else{alert('Ingrese un nombre y un correo para el registro en la base de datos.')} 
            } 
            else 
                {alert('Esperando el regId del registro en GCM!');} 
        } 
        </script> 
    </body> 
</html>
